Function Reference

_DateToDayOfWeek

Returns the weekdaynumber for a given date.

#include <date.au3>
_DateToDayOfWeek ( $iYear, $iMonth, $iDay )

 

Parameters

$iYear A valid year in format YYYY
$iMonth A valid month in format MM
$iDay A valid day in format DD

 

Return Value

Success: Returns Day of the Week Range is 1 to 7 where 1=Sunday.
Failure: 0
@Error: 0 = No error.
1 = Invalid Input Date

 

Remarks

None.

 

Related

_DateToDayOfWeekISO, _DateDayOfWeek, _DayValueToDate, _DateAdd, _DateDiff

 

Example


#include <Date.au3>

; Week day number for a given date
$iWeekday = _DateToDayOfWeek (@YEAR, @MON, @MDAY)
; Should be equal to @Wday
MsgBox(4096, "", "Todays WeekdayNumber is: " & $iWeekDay)
MsgBox(4096, "", "Today is a : " & _DateDayOfWeek($iWeekDay))